package com.oracle.application.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.oracle.application.entity.Orderinfo;
import com.oracle.application.service.IOrderinfoService;
import com.oracle.application.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhaoran
 * @since 2021-07-06
 */
@RestController
@RequestMapping("/orderinfo")
public class OrderinfoController {

    @Autowired
    private IOrderinfoService iOrderinfoService;

    @GetMapping("/getAll")
    public R<List<Orderinfo>> getAllOrderInfo(@RequestParam("orderid")Integer orderid){
        Orderinfo orderinfo = new Orderinfo();
        orderinfo.setOrderid(orderid);
        QueryWrapper<Orderinfo> queryWrapper = new QueryWrapper<Orderinfo>(orderinfo);
        List<Orderinfo> orderinfoList = (List<Orderinfo>) this.iOrderinfoService.getOne(queryWrapper);
        return new R<List<Orderinfo>>(200,"success",orderinfoList);
    }
}
